<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/static/css/order.css">
</head>
<body>
<div class="layui-fluid">
    <fieldset class="layui-elem-field">
        <legend>退款管理</legend>
        <div class="layui-field-box">
            <div class="layui-card">
                <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">状态</label>
                            <div class="layui-input-inline">
                                <select name="status">
                                    <option value="">全部</option>
                                    <option value="0" {eq name='$status' value='0'}selected{/eq}>待审核</option>
                                    <option value="1" {eq name='$status' value='1'}selected{/eq}>已通过</option>
                                    <option value="2" {eq name='$status' value='2'}selected{/eq}>未通过</option>
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
                                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                            </button>
                        </div>
                    </div>
                </div>
                <div class="layui-card-body">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th class="center">订单详情</th>
                            <th class="center" width="200">申请时间</th>
                            <th class="center" width="60">金额</th>
                            <th class="center" width="100">订单状态</th>
                            <th class="center" width="120">操作</th>
                        </tr>
                        </thead>
                    </table>
                    {volist name='list' id='vo'}
                    <table class="layui-table table">
                        <thead>
                        <tr style="background-color: #f7f7f7;">
                            <th colspan="5">
                                <i>订单号</i>: {$vo.order}<span></span>
                            </th>
                        </tr></thead>
                        <tbody>
                        <tr>
                            <td style="padding: 15px;">
                                {volist name='vo.lower' id='voo'}
                                <div class="flex">
                                    <img class="img" src="/uploads/{$voo.img}">
                                    <div class="info">
                                        <div class="inline">{$voo.name}</div>
                                        <div class="fl">x{$voo.num}</div>
                                        <div class="spec">规格/型号:{$voo.spec}</div>
                                    </div>
                                </div>
                                {/volist}
                            </td>
                            <td class="center ups" width="200">
                                {$vo.time|date='Y-m-d H:i:s', ###}
                            </td>
                            <td class="center ups" width="60">订单总额￥{$vo.money}</td>
                            <td class="center ups" width="100">
                                <p>
                                    {switch name="vo.status" }
                                    {case value="0"}待审核{/case}
                                    {case value="1"}已通过{/case}
                                    {case value="2"}已拒绝{/case}
                                    {default /}待审核
                                    {/switch}
                                </p>
                            </td>
                            <td class="center ups" width="120">
                                <p><a style="color: #337ab7;" lay-href="/admin/Product/refund_operate/id/{$vo.id}">订单详情</a></p>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    {/volist}
                    {$list->render()}
                </div>
            </div>
        </div>
    </fieldset>
</div>
<script src="/static/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'useradmin', 'table'], function(){
        var $ = layui.$,
                form = layui.form,
                table = layui.table;

        //监听搜索
        form.on('submit(LAY-app-contlist-search)', function(data){
            var field = data.field;
            //执行重载
            window.location = "/admin/Product/refund?field="+JSON.stringify(field);
        });

        //点击放大图片
        $(document).on('click', '.img', function (){
            var img = $(this).attr('src');
            layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                area: ['auto', 'auto'],
                offset: ['20%', '30%'],
                skin: 'layui-layer-nobg', //没有背景色
                shadeClose: true,
                content: '<img src="'+img+'" style="width: 400px;height: 400px;">'
            });
        });
    });

</script>
</body>
</html>
